<?php 
class CaptchaComponent extends Object
{
    function startup(&$controller)
    {
        $this->controller = $controller;
    }

    function render()
    {
App::import('Vendor', 'kcaptcha/kcaptcha');        
//vendor('kcaptcha/kcaptcha');
        $kcaptcha = new KCAPTCHA();
        $this->controller->Session->delete('captcha');
        unset ($_SESSION['captcha']); 
        $this->controller->Session->write('captcha', $kcaptcha->getKeyString());
        
    }


    function newkey()
    {
        return   $this->controller->Session->read('captcha');
    }

}
?>